//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Spreadsheet.Expressions;

namespace OpenLS.Spreadsheet.Formats.Biff.Tokens
{
    internal class ConcatToken : EmptyFormulaToken
    {
        public override FormulaTokenId TokenId
        {
            get { return FormulaTokenId.Concat; }
        }
        internal override Expression GetExpression(FormulaEvaluationContext context)
        {
            FormulaToken t1 = context.PoppedArgument();
            Expression right = t1.GetExpression(context);
            FormulaToken t2 = context.PoppedArgument();
            Expression left = t2.GetExpression(context);
            return new ConcatenateExpression(left, right);
        }
    }
}